package cate.common.table.activity.heroup.call;

import cate.common.table.ESheet;
import cate.common.table.activity.base.ShopActivityBaseRow;
import easy.java.dev.note.NoteClass;

import java.util.LinkedList;
import java.util.List;

@NoteClass(value = "英雄上新活动-进度奖励")
public class HeroUpProgressSheet extends ESheet<HeroUpProgressRow> {
    @Override
    public String getSheetName() {
        return "进度奖励";
    }

    public String getRewardByTimes(int groupId, int times) {
        for (HeroUpProgressRow row : getList()) {
            if (groupId == row.groupId && times == row.callTimes) {
                return row.rewardStr;
            }
        }
        return "";
    }

    public HeroUpProgressRow getRowByTimes(int rewardGroup, int times) {
        for (HeroUpProgressRow row : getList()) {
            if (rewardGroup == row.groupId && times == row.callTimes) {
                return row;
            }
        }
        return null;
    }

    public List<HeroUpProgressRow> getListByGroup(int groupId) {
        List<HeroUpProgressRow> list = new LinkedList<>();
        for (HeroUpProgressRow row : getList()) {
            if (groupId == row.groupId) {
                list.add(row);
            }
        }
        return list;
    }
}
